import request from '@/utils/request'

// 查询用户apikey列表
export function listApi(query) {
  return request({
    url: '/platform/api/list',
    method: 'get',
    params: query
  })
}

// 查询用户apikey详细
export function getApi(apiId) {
  return request({
    url: '/platform/api/' + apiId,
    method: 'get'
  })
}

// 新增用户apikey
export function addApi(data) {
  return request({
    url: '/platform/api',
    method: 'post',
    data: data
  })
}

// 修改用户apikey
export function updateApi(data) {
  return request({
    url: '/platform/api',
    method: 'put',
    data: data
  })
}

// 删除用户apikey
export function delApi(apiId) {
  return request({
    url: '/platform/api/' + apiId,
    method: 'delete'
  })
}

// 导出用户apikey
export function exportApi(query) {
  return request({
    url: '/platform/api/export',
    method: 'get',
    params: query
  })
}